package com.wilson.treeviewer.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UserList extends ArrayList<User> {

    private static final long serialVersionUID = 4159173090699216519L;

    private final Map<String, User> map;

    public UserList(List<User> users) {
        super(users);

        this.map = new HashMap<>();
        for (User user : users) {
            map.put(user.getId(), user);
        }
    }

    public User getUser(String id) {
        return map.get(id);
    }

}
